A computer network, e.g., a local area network (LAN), is a collection of interconnected computing devices that can exchange data and share resources. It is often desirable to divide a LAN into multiple segments in order to improve the performance of the LAN. Certain devices, such as layer 2 network devices, e.g., switches or bridges, may be used to interconnect LAN segments to one another. Such devices may improve the performance of the LAN by preventing packets that are not destined for devices on a particular segment from being forwarded to that segment.
In addition to improving the performance of a LAN, the layer 2 network devices interconnecting LAN segments provide redundant pathways within the LAN. That is, the interconnection of the layer 2 network devices creates multiple pathways for packets to traverse the network. This redundancy is desirable in the event that one of the layer 2 devices becomes inactive, e.g., a device is taken out of service or otherwise becomes inoperative, thereby allowing another active link to carry packets between LAN segments. However, by providing redundancy, i.e., multiple pathways between LAN segments, unwanted loops may be created within the LAN.
In order to break loops created within the LAN, the layer 2 network devices interconnecting the LAN segments may logically block one or more of their ports. In order to determine which ports to logically block, the layer 2 network devices interconnecting the LAN segments execute a spanning tree algorithm defined by a spanning tree protocol, e.g., a spanning tree protocol or rapid spanning tree protocol. A network administrator, for example, assigns a cost, or “path cost,” to each port on each layer 2 network device interconnecting the LAN segments. A path cost is the cost of a link on the spanning tree network that terminates a given port. For example, if a first link is further away from a root bridge than a second link, the first link may be assigned a higher path cost. Also, the technology of the link may be factored into the cost. For example, a link that is optical fiber may have a lower cost than a link that is copper, due to the generally faster transmission rates of optical fiber. In this manner, a cost is associated with each spanning tree link. The spanning tree protocol uses a spanning tree algorithm to determine which port(s) to logically block based on the associated path cost.